home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Sessions / Completions / Completions Source / Files / FileCloser.cp < prev    next >
Encoding:
Text File  |  1998-06-17  |  534 b   |  36 lines  |  [TEXT/CWIE]

  1. // FileCloser.cp
  2.  
  3. #ifndef FileCloser_h
  4. #include "FileCloser.h"
  5. #endif
  6. #ifndef FileReadingPath_h
  7. #include "FileReadingPath.h"
  8. #endif
  9. #ifndef __DEVICES__
  10. #include <Devices.h>
  11. #endif
  12.  
  13. Task *FileCloser::operator()( FileReadingPath& thePath )
  14.   {
  15.     Assert( !Running() );
  16.     Assert( thePath.IsOpen() );
  17.     
  18.     ioParam.ioVersNum = 0;
  19.     ioParam.ioRefNum = thePath.RefNum();
  20.     path = &thePath;
  21.     
  22.     return this;
  23.   }
  24.  
  25. void FileCloser::Launch()
  26.   {
  27.     Assert( !Running() );
  28.  
  29.     path->SetRefNum( 0 );
  30.     PBCloseAsync( this );
  31.   }
  32.  
  33. void FileCloser::Kill()
  34.   {
  35.   }
  36.